package com.lhc.nacosconsumer.mapper;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.lhc.nacosconsumer.entity.Stock;
import org.apache.ibatis.annotations.Mapper;

/**
 * @author liuchaoqun
 * @date 2022/6/18
 * @Description 库存
 */
@Mapper
public interface StockMapper extends BaseMapper<Stock> {

    default Stock selectByMenuId(Long id) {
        QueryWrapper<Stock> queryWrapper = new QueryWrapper<>();
        queryWrapper.lambda().eq(Stock::getMenuId, id);
        return this.selectOne(queryWrapper);
    }

}
